﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace lucere.analysis
{
    /// <summary> A DocIdSet contains a set of doc ids. Implementing classes must
    /// only implement {@link #iterator} to provide access to the set. 
    /// </summary>
    public interface IDocIdSet
    {
        /// <summary>Provides a {@link DocIdSetIterator} to access the set.
        /// This implementation can return <code>null</code> or
        /// <code>{@linkplain #EMPTY_DOCIDSET}.iterator()</code> if there
        /// are no docs that match. 
        /// </summary>
        IDocIdSetIterator Iterator();

        /// <summary>This method is a hint for {@link CachingWrapperFilter}, if this <code>DocIdSet</code>
        /// should be cached without copying it into a BitSet. The default is to return
        /// <code>false</code>. If you have an own <code>DocIdSet</code> implementation
        /// that does its iteration very effective and fast without doing disk I/O,
        /// override this method and return true.
        /// </summary>
        bool IsCacheable { get; }
    }
}
